package com.zx.mes.hyl.factory;

import lombok.extern.java.Log;
import org.junit.Test;

/**
 * 工厂模式测试
 * @author huayunlong
 * @date 2018-9-3
 */
@Log
public class FactoryTest {

    @Test
    public void test(){
        ScanFactory.getInstance(1).scanBar();

        ScanFactory.getInstance(2).scanBar();

    }

    /**
     * 工厂方法模式
     */
    @Test
    public void test2(){
        RfidFactory factory = new RfidFactory();
        factory.build().scanBar();

        new BargunFactory().build().scanBar();
    }
}
